<!--
 * @Author: HC
 * @Date: 2022-04-22 14:42:31
 * @LastEditTime: 2022-04-22 17:13:48
 * @Description:
-->
<template>
  <div class="wholeView">
      <Dialog content="科目类别：按照C02产品分类标签"></Dialog>
    <el-table :data="tableData" size="mini" border v-loading="tableLoading" :header-cell-style="{
                    background: '#0070C0',
                    color: '#ffffff'
                }" style="width: 100%">
      <BaseColumns :columns="columns"></BaseColumns>
    </el-table>
  </div>
</template>

<script>
// import { managementSubject } from "@/api/barCode/index";

import $barCodeApi from "@/api/barCode/index";
import Dialog from './dialog.vue'
export default {
  name: "wholeView",
  components: {Dialog},
  props: {
    form: {
      type: Object,
      default: {},
    },
  },
  data () {
    return {
      tableLoading: false,
      tableData: [],
      columns: [],
    };
  },
  computed: {

  },
  created () { },
  mounted () { },
  methods: {
    getList () {
      this.tableData = []
      this.tableLoading = true;




      $barCodeApi.managementSubject({ ...this.form }, res => {
        if (res.code == 0) {



          console.log(res)
          this.tableLoading = false;
          this.columns = [
            {
              label: "",
              prop: "index_name",
              width: "100",
              align: "center",
              fixed: 'left'
            },
            ...res.content.area.map(i => {
              return {
                label: i,
                prop: i,
                width: "100",
                align: "center"
              };
            })
          ];
          this.tableData = res.content.data;
        }
      });








      // managementSubject(this.form).then((res) => {
      //   if (res.code == 0) {
      //     this.tableLoading = false;
      //     this.columns = [
      //       {
      //         label: "",
      //         prop: "index_name",
      //         width: "100",
      //         align: "center",
      //         fixed: 'left'
      //       },
      //       ...res.data.area.map(i => {
      //         return {
      //           label: i,
      //           prop: i,
      //           width: "100",
      //           align: "center"
      //         };
      //       })
      //     ];
      //     this.tableData = res.data.data;
      //   }
      // });
    },
  },
};
</script>

<style scoped>
</style>
